﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminMaster.Master" AutoEventWireup="true" ValidateRequest="false" CodeFile="CreateArticle.aspx.cs" Inherits="ArchitectSite.Admin.Article.CreateArticle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Scripts/lib/jBreadcrumbs/css/BreadCrumb.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/lib/jquery-ui/css/smoothness/jquery-ui-1.8.20.custom.css"
        rel="stylesheet" type="text/css" />
    <script src="../../Scripts/lib/jBreadcrumbs/jquery.jBreadCrumb.1.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery-ui/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script>
    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="../../ckfinder/ckfinder.js" type="text/javascript"></script>
    <script>
        $(document).ready(function () {
            //            CKEDITOR.replace('ContentPlaceHolderMain_dataDescription', {
            //                filebrowserBrowseUrl: '/ckfinder/ckfinder.html',
            //                filebrowserImageBrowseUrl: '/ckfinder/ckfinder.html?type=Images',
            //                filebrowserFlashBrowseUrl: '/ckfinder/ckfinder.html?type=Flash',
            //                filebrowserUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
            //                filebrowserImageUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
            //                filebrowserFlashUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
            //            
            //            });
            loadEditor("ContentPlaceHolderMain_dataDescription");
            $('#ContentPlaceHolderMain_dataPublishedDate').datepicker();
            $("#btnSelectImg").click(function () {
                var finder = new CKFinder();
                finder.selectActionFunction = function (fileUrl) {
                    $('#<%=dataThumbnail.ClientID %>').val(fileUrl);
                };
                finder.popup();
            });
        });

        function loadEditor(id) {
            var instance = CKEDITOR.instances[id];
            if (instance) {
                CKEDITOR.remove(instance);
            }
            CKEDITOR.replace(id);
        }

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <nav>
        <div id="jCrumbs" class="breadCrumb module">
            <ul>
                <li>
                    <a href="#"><i class="icon-home"></i></a>
                </li>
                <li>
                    <a href="#">Article</a>
                </li>
                <li>
                    <a href="#">Add New</a>
                </li>
            </ul>
        </div>
    </nav>
    <div class="row-fluid">
        <div class="span12">
		                    <table border="0" cellpadding="3" cellspacing="1"> 
                                <tr>
                                    <td  colspan="2">
                                        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
                                            <ContentTemplate>       
                                                <table width="100%">
                                                    <tr>
                                                        <td class="literal" style="width:95px"><asp:Label ID="Label1" runat="server" Text="Danh Mục:" AssociatedControlID="dataMenuId" /></td>
                                                        <td>
					                                        <asp:DropDownList runat="server" ID="dataCategory" AutoPostBack="true" DataTextField="Title" 
                                                                DataValueField="ID" onselectedindexchanged="dataCategory_SelectedIndexChanged"></asp:DropDownList>                                        
				                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="literal"><asp:Label ID="lbldataMenuId" runat="server" Text="Chủ đề:" AssociatedControlID="dataMenuId" /></td>
                                                        <td>
					                                        <asp:DropDownList runat="server" ID="dataMenuId" DataValueField="ID" DataTextField="Title"></asp:DropDownList>                                        
				                                        </td>
			                                        </tr>

                                                </table>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </td>
			                    </tr>                                
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataTitle" runat="server" Text="<%$ Resources:title %>" AssociatedControlID="dataTitle" /></td>
                                    <td>
					                    <asp:TextBox runat="server" ID="dataTitle" CssClass="span6"  MaxLength="200"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="ReqVal_dataTitle" runat="server" Display="Dynamic" ControlToValidate="dataTitle" ErrorMessage="Required"></asp:RequiredFieldValidator>
				                    </td>
			                    </tr>
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataSummary" runat="server" Text="Summary:" AssociatedControlID="dataSummary" /></td>
                                    <td>
					                    <asp:TextBox runat="server" ID="dataSummary"  TextMode="MultiLine"  CssClass="span6" Rows="4"></asp:TextBox>
				                    </td>
			                    </tr>
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataDescription" runat="server" Text="Description:" AssociatedControlID="dataDescription" /></td>
                                    <td>
					                    <asp:TextBox runat="server" ID="dataDescription"  TextMode="MultiLine"  Width="250px" Rows="5"></asp:TextBox>
				                    </td>
			                    </tr>
			                    
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataThumbnail" runat="server" Text="Thumbnail:" AssociatedControlID="dataThumbnail" /></td>
                                    <td>
					                    <asp:TextBox runat="server" ID="dataThumbnail"  MaxLength="200"></asp:TextBox>
                                        <input type="button" id="btnSelectImg" value="Chọn ..." />
				                    </td>
			                    </tr>			                    
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataOrderIndex" runat="server" Text="Order Index:" AssociatedControlID="dataOrderIndex" /></td>
                                    <td>
					                    <asp:TextBox runat="server" ID="dataOrderIndex"></asp:TextBox>
                                        <asp:RangeValidator ID="RangeVal_dataOrderIndex" runat="server" Display="Dynamic" ControlToValidate="dataOrderIndex" ErrorMessage="Invalid value" MaximumValue="2147483647" MinimumValue="-2147483648" Type="Integer"></asp:RangeValidator>
				                    </td>
			                    </tr>
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataPublishedDate" runat="server" Text="Published Date:" AssociatedControlID="dataPublishedDate" /></td>
                                    <td>
					                    <asp:TextBox runat="server" ID="dataPublishedDate" MaxLength="10"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFielddataPublishedDate" runat="server" Display="Dynamic" ControlToValidate="dataPublishedDate" ErrorMessage="Required"></asp:RequiredFieldValidator>
				                    </td>
			                    </tr>
                                <tr>
                                    <td class="literal"><asp:Label ID="lbldataIsPublished" runat="server" Text="Is Published:" AssociatedControlID="dataIsPublished" /></td>
                                    <td>
					                    <asp:CheckBox ID="dataIsPublished" Checked="true"  runat="server"/>
				                    </td>
			                    </tr>
			                    <tr>
                                    <td class="literal"><asp:Label ID="lbldataIsHot" runat="server" Text="Is Hot:" AssociatedControlID="IsHot" /></td>
                                    <td>
					                   <asp:CheckBox ID="IsHot"  runat="server"/>
				                    </td>
			                    </tr>
                                <tr>
                                      <td>
                                        
                                     </td>
                                      <td>
                                        <asp:Button runat="server" CssClass="btn btn-danger " ID="btnCancel" CausesValidation="false" 
                                              Text="Cancel" PostBackUrl="~/Admin/Article/Default.aspx"/>
                                        <asp:Button runat="server" CssClass="btn  btn-primary " ID="btnSave" Text="Save" 
                                              onclick="btnSave_Click"/>
                                     </td>
                                </tr>			
		                    </table>
                
        </div>
    </div>      
</asp:Content>
